/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package CareerService.Entitybeans;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "interview")
@NamedQueries({@NamedQuery(name = "Interview.findAll", query = "SELECT i FROM Interview i"), @NamedQuery(name = "Interview.findByInterviewid", query = "SELECT i FROM Interview i WHERE i.interviewid = :interviewid"), @NamedQuery(name = "Interview.findByInterviewData", query = "SELECT i FROM Interview i WHERE i.interviewData = :interviewData"), @NamedQuery(name = "Interview.findByLocation", query = "SELECT i FROM Interview i WHERE i.location = :location")})
public class Interview implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "interviewid")
    private Integer interviewid;
    @Basic(optional = false)
    @Column(name = "interview_data")
    @Temporal(TemporalType.TIMESTAMP)
    private Date interviewData;
    @Basic(optional = false)
    @Column(name = "location")
    private String location;
    @JoinColumn(name = "emnum", referencedColumnName = "emnum")
    @ManyToOne(optional = false)
    private Employer emnum;
    @JoinColumn(name = "stu_id", referencedColumnName = "stu_id")
    @ManyToOne(optional = false)
    private Student stuId;

    public Interview() {
    }

    public Interview(Integer interviewid) {
        this.interviewid = interviewid;
    }

    public Interview(Integer interviewid, Date interviewData, String location) {
        this.interviewid = interviewid;
        this.interviewData = interviewData;
        this.location = location;
    }

    public Integer getInterviewid() {
        return interviewid;
    }

    public void setInterviewid(Integer interviewid) {
        this.interviewid = interviewid;
    }

    public Date getInterviewData() {
        return interviewData;
    }

    public void setInterviewData(Date interviewData) {
        this.interviewData = interviewData;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public Employer getEmnum() {
        return emnum;
    }

    public void setEmnum(Employer emnum) {
        this.emnum = emnum;
    }

    public Student getStuId() {
        return stuId;
    }

    public void setStuId(Student stuId) {
        this.stuId = stuId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (interviewid != null ? interviewid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Interview)) {
            return false;
        }
        Interview other = (Interview) object;
        if ((this.interviewid == null && other.interviewid != null) || (this.interviewid != null && !this.interviewid.equals(other.interviewid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "CareerService.Entitybeans.Interview[interviewid=" + interviewid + "]";
    }

}
